package com.dingwen.treasure.kettle.execute;

import com.dingwen.treasure.kettle.enums.FileTypeEnum;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 　KettleExecute
 * 　@author dingwen
 * 　@date 2022/8/23
 */
@Component
public class KettleExecute {

    /**
     * 转换执行
     */
    @Resource
    private TransExecute transExecute;

    /**
     * 作业执行
     */
    @Resource
    private JobExecute jobExecute;

    /**
     * exe
     *
     * @param fileType 文件类型
     * @param fileFullName   文件名称
     */
    public void exe(FileTypeEnum fileType, String fileFullName) {
        switch (fileType) {
            case JOB:
                jobExecute.execute(fileFullName);
                break;
            case TRANS:
                transExecute.execute(fileFullName);
                break;
            default:
                break;
        }
    }
}
